package com.eshore.mq.producer.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Service;

import javax.jms.Destination;

/**
 * @author ZhouXiong
 * @Description
 * @apiDefine Created by ZhouX on 2021/9/6
 */
@Service
public class MqProducerService {

    @Autowired
    private JmsMessagingTemplate jmsMessagingTemplate;

    public void sendMessage(String msg, Destination destination) {
        this.jmsMessagingTemplate.convertAndSend(destination, msg);
    }

}
